package com.cloudwebrtc.voip.mediaengine;

import java.util.Vector;

public class StreamType {
	static private Vector<StreamType> values = new Vector<StreamType>();
	public static StreamType RawStream = new StreamType("RawStream",0);
	public static StreamType AudioStream = new StreamType("AudioStream",1);
	public static StreamType VideoStream = new StreamType("VideoStream",2);
	public static StreamType DataStream = new StreamType("DataStream",3);
	private String mStringValue;
	private int mIntgerValue;
	private StreamType(String aStringValue,int aIntgerValue) {
		mStringValue = aStringValue;
		mIntgerValue = aIntgerValue;
		values.addElement(this);
	}
	public String toString() {
		return mStringValue;
	}
	public int IntgerValue()
	{
		return mIntgerValue;
	}
	
	public static StreamType fromInt(int value) {
		for (int i = 0; i < values.size(); i++) {
			StreamType mtype = (StreamType) values.elementAt(i);
			if (mtype.mIntgerValue == value) return mtype;
		}
		throw new RuntimeException("CallState not found [" + value + "]");
	}
}
